<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>navigator对象</title>
</head>
<body>
<button class="b1">appCodeName:获取浏览器的内部名称</button>
<button class="b1">appName:获取浏览器的完整名称</button>
<button class="b1">appVersion:获取浏览器的平台和版本信息</button>
<button class="b1">cookieEnable:获取指明浏览器中是否启用cookie的布尔值</button>
<button class="b1">platform:获取运行浏览器的操作系统平台</button>
<button class="b1">userAgent:获取由浏览器发送到服务器的User-Agent值</button>
<button class="b1">启用java</button>
<button class="b1">禁用java</button>
<script>
  var btn=document.querySelectorAll('.b1');
  btn[0].onclick=function (){
    console.log('appCodeName:'+navigator.appCodeName);
  }
  btn[1].onclick=function (){
    console.log('appName'+navigator.appName);
  }
  btn[2].onclick=function (){
    console.log('appVersion'+navigator.appVersion);
  }
  btn[3].onclick=function (){
    console.log('cookieEnable'+navigator.cookieEnabled);
  }
  btn[4].onclick=function (){
    console.log('platform'+navigator.platform);
  }
  btn[5].onclick=function (){
    console.log('userAgent'+navigator.userAgent);
  }
  btn[6].onclick=function (){
    navigator.javaEnabled();
  }
</script>
</body>
</html>